<template>
  <div>
    <div class="title">猜你喜欢</div>
    <ul>
      <router-link tag="li" class="item" v-for="item of list" :key="item.id" :to="'/detail/' + item.id">
        <div class="item-img-wrapper">
          <img class="item-img" :src="item.imgURL" />
        </div>
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <div class="item-price">
            <p class="number-wrapper">
              <span class="number">￥{{item.price}}</span>起
            </p>
            <p class="location">{{item.location}}</p>
          </div>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  .title
    margin-top .1rem
    line-height .8rem
    text-indent .2rem
    background-color #eee
  .item
    display flex
    height 2rem
    padding .2rem 0
    border-bottom 1px solid #eee
    .item-img-wrapper
      margin 0 .2rem
      height 2rem
      .item-img
        height 100%
    .item-info
      flex 1
      padding-left .1rem
      .item-title
        margin-top .26rem
        font-size .32rem
      .item-desc
        margin-top .26rem
        height .34rem
        line-height .34rem
        color #616161
      .item-price
        margin-top .28rem
        color #616161
        height .4rem
        line-height .4rem
        font-size .24rem
        p
          display inline
          .number
            font-size .4rem
            color #ff8300
            margin-right .04rem
        .location
          float right
          margin-right .3rem
          padding-top .06rem
</style>
